<%@ page import="database.CourseDb" %>
<%@ page import="database.Course" %>
<%@ page import="database.CommentDb" %>
<%@ page import="java.util.List" %>
<%@ page import="utils.StringUtils" %>
<%@ page import="database.Comment" %><%--
  Created by IntelliJ IDEA.
  User: jimmyhsu
  Date: 2016/12/14
  Time: 19:00
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>退课理由</title>
    <link rel="stylesheet" href="../../static/style/weui.css"/>
    <link rel="stylesheet" href="../../static/example/example.css"/>
    <link rel="stylesheet" href="../../static/style/myStyle.css"/>
    <%
        int courseId = Integer.parseInt(request.getParameter("courseId"));
        Course course = CourseDb.selectCourseById(courseId);
        List<Comment> quitReasons = CommentDb.selectQuitReasonsByCourseId(courseId, 0, 999);
    %>
</head>
<body style="background-color: transparent; color: #ffffff;">
<%@include file="Do/checkAdminLogin.jsp"%>
<br><br>
<img src="../../static/image/arrow1.png" style="-ms-transform:rotate(90deg); /* IE 9 */
    -moz-transform:rotate(90deg); /* Firefox */
    -webkit-transform:rotate(90deg); /* Safari and Chrome */
    -o-transform:rotate(90deg); /* Opera */" onclick="history.go(-1);">

<h1 class = "page_title"><%=course.getName() + "的退课理由"%></h1>
<table class='zebra'>
    <tr>
        <th>编号</th>
        <th>学号</th>
        <th>理由</th>
    </tr>
    <%
    for (int i = 0; i < quitReasons.size(); i++) {
        Comment reason = quitReasons.get(i);
        if(!StringUtils.isEmpty(reason.getComment())){
            %>
    <tr>
        <td><%=(i+1)%></td>
        <td><%=reason.getStudentId()%></td>
        <td><%=reason.getComment()%></td>
    </tr>
    <%
        }
    }
    %>
</table>
</body>
</html>
